package net.takela.auth.login;

import net.takela.auth.token.token.AuthTokenManager;
import net.takela.auth.token.token.AuthTokenProperties;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class LoginAutoConfig {

    @Bean("authTokenProperties")
    @ConfigurationProperties(prefix = "auth.token")
    public AuthTokenProperties authTokenProperties(){
        return new AuthTokenProperties();
    }

    @Bean
    public AuthTokenManager authTokenManager(@Qualifier("authTokenProperties") AuthTokenProperties authTokenProperties){
        return new AuthTokenManager(authTokenProperties);
    }
}
